package com.haifeng.myhookdemo;

import android.app.Application;
import android.os.Build;

public class MyApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        MyHookUtil myHookUtil=new MyHookUtil();
        if (Build.VERSION_CODES.O > Build.VERSION.SDK_INT) {
            myHookUtil.hookAmsBefore26(this);
        } else if(Build.VERSION.SDK_INT>Build.VERSION_CODES.O&&Build.VERSION.SDK_INT<Build.VERSION_CODES.Q) {
            try {
                myHookUtil.hookAMSAfter26();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }else{
            try {
                myHookUtil.hookAMSother();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    myHookUtil.hookActivityHm();
    }
}
